﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Text;
using DTcms.Common;
using System.Data;

namespace DTcms.Web.UI.Page
{
    public partial class foreman_show : Web.UI.BasePage
    {
        protected int id;
        protected string page = string.Empty;
        protected Model.foreman_user model = new Model.foreman_user();
        
        /// <summary>
        /// 重写虚方法,此方法将在Init事件前执行
        /// </summary>
        protected override void ShowPage()
        {
            id = DTRequest.GetQueryInt("id");
            page = DTRequest.GetQueryString("page");
            BLL.foreman_user bll = new BLL.foreman_user();

            if (id > 0) //如果ID获取到，将使用ID
            {
                if (!bll.Exists(id))
                {
                    HttpContext.Current.Response.Redirect(linkurl("error", "?msg=" + Utils.UrlEncode("出错啦，您要浏览的页面不存在或已删除！")));
                    return;
                }
                model = bll.GetModel(id);
                if (model.user_id>0)
                {
                    model.user = new BLL.users().GetModel(model.user_id);
                }
            }
            else
            {
                return;
            }
           
        }
    }
}
